package server.business.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;
import server.main.config.cache.MybatisPlusRedisCache;
import server.business.pojo.BloodSample;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* @author Galaxy
* @description 针对表【blood_sample】的数据库操作Mapper
* @createDate 2022-11-08 12:46:23
* @Entity server.business.pojo.BloodSample
*/
@Mapper
//@CacheNamespace(implementation = MybatisPlusRedisCache.class)
public interface BloodSampleMapper extends BaseMapper<BloodSample> {
    /**
     * 根据id查找血液样本
     * @param id
     * @return
     */
    @Select("SELECT * FROM blood_sample where id=#{id}")
    BloodSample selectById(Long id);

    /**
     * 根据血液样本编号查找
     * @param number
     * @return
     */
    @Select("SELECT * FROM blood_sample where number=#{number}")
    BloodSample selectByNumber(String number);
    /**
     * 根据血液id找到血液样本
     */

    @Select("SELECT * FROM blood_sample where blood_number=#{bloodId}")
    BloodSample selectByBloodId(String bloodId);

    IPage<BloodSample> selectBloodSamplePage(IPage<T> page, @Param(Constants.WRAPPER) Wrapper<BloodSample> queryWrapper);
}




